/*
 * @Author: gonglf
 * @Date: 2022-08-22 14:52:02
 * @LastEditors: gonglf
 * @LastEditTime: 2022-08-22 15:00:37
 * @Description:
 *
 */
package main

import (
	"context"
	"fmt"
	"log"

	"gitee.com/network-learning/rpc/4gRPC/pb"
	"google.golang.org/grpc"
)

func main() {
	conn, err := grpc.Dial("localhost:1234", grpc.WithInsecure())
	if err != nil {
		log.Fatal(err)
	}
	defer conn.Close()

	client := pb.NewHelloServiceClient(conn)
	reply, err := client.Hello(context.Background(), &pb.String{Value: "龚凌锋"})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(reply.GetValue())
}
